import test.Beverage;
import test.component.BlackTea;
import test.seasoning.Candy;
import test.seasoning.Tea;

/**
 * @Author: Wyndem
 * @Description: 装饰者模式
 * @Date: Created in  2019-01-21 20:31
 * @Modified By:
 */
public class Main {



    public static void main(String[] args) {
        //创造一杯 双糖红茶

        //首先创建一杯红茶
        Beverage blackTea = new BlackTea();
        //加糖
        blackTea=new Candy(blackTea);
        //双倍的糖
        blackTea=new Candy(blackTea);
        System.out.println(new StringBuilder("总共价格为：")
                    .append(blackTea.cost())
                    .append(",清单为：")
                    .append(blackTea.getDescription()));



        //双糖加茶的红茶
        blackTea = new Tea(blackTea);
        System.out.println(new StringBuilder("总共价格为：")
                .append(blackTea.cost())
                .append(",清单为：")
                .append(blackTea.getDescription()));

    }


}
